<?php

class Producto{
	
	public $bd;
	public $resultado;
	
	public function __construct(){
		
		$this->bd = new Basedatos();
		
	}
	public function mostrar_todos_producto(){
		$query = "SELECT * FROM producto";
		$this->result = $this->bd->select($query);
		return $this->result;
	}
	public function mostrar_un_producto(){
		$query = "SELECT * FROM producto WHERE id_producto = '".$_GET['producto']."'";
		$this->result = $this->bd->select($query);
		return $this->result;
	}
	public function mostrar_producto_categoria(){
		$query = "SELECT * FROM producto WHERE id_categoria = '".$_GET['categoria']."'";
		$this->result = $this->bd->select($query);
		return $this->result;	
	}
	public function mostrar_oferta(){
		$query = "SELECT * FROM producto WHERE estado_oferta = '".$_GET['categoria']."'";
		$this->result = $this->bd->select($query);
		return $this->result;	
	}
}
?>